package com.dingjian.broker.enums;

/**
 * 意向类型
 * 
 * @author guhui
 *
 */
public enum IntentionTypeEnum {
	BUY("BUY","买"), //售
	RENT("RENT","租"), //租
	NEW("NEW","联动");//联动
	
	private IntentionTypeEnum(){
		
	}
	private IntentionTypeEnum(String key,String display){
		this.key=key;
		this.display=display;
	}
	private String display;
	private String key;
	public String getDisplay() {
		return display;
	}
	public void setDisplay(String display) {
		this.display = display;
	}
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	/**
	 * 取枚举的json字符串
	 * @return
	 */
	public static String getJsonStr(){
		IntentionTypeEnum[] enums = IntentionTypeEnum.values();
		StringBuffer jsonStr = new StringBuffer("[");
		for (IntentionTypeEnum senum : enums) {
			if(!"[".equals(jsonStr.toString())){
				jsonStr.append(",");
			}
			jsonStr.append("{id:'")
					.append(senum)
					.append("',name:'")
					.append(senum.getDisplay())
					.append("',value:'")
					.append(senum)
					.append("'}");
		}
		jsonStr.append("]");
		return jsonStr.toString();
	}
	
}
